/**
 * @Date 2023-02-24 16:31:29
 * @Remark
 */

// lib
// config
// script & methods & public
import toast from "components/toast";
// store
// service
import { userRegisterService } from "biz/Auth/service";
// interface
// 其它
export async function userRegister(form: any, setLoading: (val: boolean) => void,
  getCode: () => void,
) {
  // 调用服务
  setLoading(true);
  const result = await userRegisterService(
    form
  );
  setLoading(false);
  // 成功
  if (!result.payload) {
    getCode();
    return false;
  }
  toast.success("注册成功,请登录");
  return true
}
